//
//  Parents.m
//  OC1_类和对象课后作业
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Parents.h"

@implementation Parents

-(id)init
{

    _age = 56;
    _sex = @"male";
    [self info];
    return self;

}

-(void)info
{

    NSLog(@"%@ %ld", _sex, _age);

}


-(void)mother
{

    NSLog(@"我妈今年%ld岁", _age);

}


-(NSString *)sex
{
    return _sex;
}

-(void)setSex:(NSString *)sex
{
    _sex = sex;
}
-(NSInteger)age
{
    return _age;
}
-(void)setAge:(NSInteger)age
{
    _age = age;
}
-(id)initWithSex:(NSString *)sex age:(NSInteger)age
{
    _sex = sex;
    _age = age;
    return self;
}

+ (id)parentsWithSex:(NSString *)sex age:(NSInteger)age
{
    Parents *p = [[Parents alloc] initWithSex:sex age:age];
    return p;
}


@end
